class Solution {
    public:
        void sortColors(vector<int>& nums) {
                   int slow=0;int quick=0;
                          int size=nums. size();
                                 while(quick<size)
                                        {
                                                       if(nums[quick]==0){
                                                                          swap(nums[slow], nums[quick]);
                                                                                         slow++;
                                                       }
                                                                  quick++;
                                        }
                                               quick=slow; 
                                                      while(quick<size)
                                                             {
                                                                            if(nums[quick]==1){
                                                                                               swap(nums[slow], nums[quick]);
                                                                                                              slow++;
                                                                            }
                                                                                       quick++;
                                                             }
        }
};
                                                                            }
                                                             }
                                                       }
                                        }
        }
}